#ifndef __COMMON_QUEUE_API_H_
#define __COMMON_QUEUE_API_H_

#include "queuedef.h"

void queue_init(Queue q);


/**
 * @brief push queuenode into queue
 * Notice that bothe q and node are pointer
 * @note O(1)
 */
boolean queue_push(Queue q, QueueNode node);

/**
 * @brief get the first node of the queue
 * @note O(1)
 * @param q the queue
 * @return QueueNode 
 */
QueueNode queue_pop(Queue q);

/**
 * @brief get the last node of the queue
 * @note O(1)
 *
 * @param q the queue
 * @return QueueNode 
 */
QueueNode queue_popback(Queue q);

/**
 * @brief remove node from the queue
 * @note O(1)
 * @param q the queue
 * @param node the node need to be removed
 * @return boolean 
 */
boolean queue_remove(Queue q, QueueNode node);
#endif//__COMMON_QUEUE_API_H_